﻿using System;
using System.Collections.Generic;
using Luna.Connectors;

namespace Luna.Model.Configuration
{
    public interface IConfigurationService
    {
        /// <summary>
        /// Gets the current database descriptor.
        /// </summary>
        /// <value>The current database descriptor.</value>
        IDatabaseDescriptor Current { get; }

        /// <summary>
        /// Open a new database store.
        /// </summary>
        /// <param name="storePath">Store path.</param>
        void Open(string storePath);

        /// <summary>
        /// Creates a new database store.
        /// </summary>
        void New();

        /// <summary>
        /// Saves the current database in a new store.
        /// </summary>
        /// <param name="storePath">The store path.</param>
        void SaveAs(string storePath);

        /// <summary>
        /// Occurs when current database store has changed.
        /// </summary>
        event EventHandler DatabaseChanged;

        #region Connectors

        IDictionary<ConnectorType, IConnectorConfiguration> ConnectorConfigurations { get; }

        void Configure(IConnectorConfiguration connector);

        void Disable(IConnectorConfiguration connector);

        string Test(IConnectorConfiguration connector);

        #endregion Connectors
    }
}